﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Sinacor.Service.Infra.AuthorizationService.Service.ServiceImplementation.Translator
{
	public static class TranslateBetweenUserRoles
	{
		public static BusinessEntity.UserRoles ToBusinessEntity(DataContract.Request.RetrieveUserRolesRequest from)
		{
			BusinessEntity.UserRoles to = new BusinessEntity.UserRoles();
			to.ModuleId = from.ModuleId;
			return to;
		}

		public static DataContract.Response.UserRolesResponse ToDataContract(BusinessEntity.UserRoles from)
		{
			DataContract.Response.UserRolesResponse to = new DataContract.Response.UserRolesResponse();
			to.Role = from.Role;
			return to;
		}

		public static List<DataContract.Response.UserRolesResponse> ToDataContractList(List<BusinessEntity.UserRoles> from)
		{
			List<DataContract.Response.UserRolesResponse> to = new List<DataContract.Response.UserRolesResponse>();
			foreach (BusinessEntity.UserRoles item in from)
			{
				to.Add(ToDataContract(item));
			}
			return to;
		}
	}
}